import React from 'react'
import '../css/router.css'
import {
    HashRouter,
    Switch,
    Route,
    Link
} from 'react-router-dom'
import Desc from './content/desc'
import Cultural from './content/cultural'
import Team from './content/team'
import Exercise from './content/exercise'
import News from './content/news'
import Join from './content/join'
import Relation from './content/relation'
import Call from './content/call'


class Router extends React.Component {
    render() {
        return (
            <div className="box">
                <div className="nav_box">
                    <div className="nav_left">
                        <p>小米商城</p>
                        <p>MIUI</p>
                        <p>ioT</p>
                        <p>云服务</p>
                        <p>天星数科</p>
                        <p>有品</p>
                        <p>小爱开放平台</p>
                        <p>企业团购</p>
                        <p>资质证照</p>
                        <p>协议规则</p>
                        <p>下载app</p>
                        <p>Select Location</p>
                    </div>
                    <div className="nav_right">
                        <p onClick={()=> {
                            // console.log(this)
                            this.props.history.push({
                                pathname: '/login'
                            })
                        }}>登录</p>
                        <p onClick={()=> {
                            this.props.history.push({
                                pathname: '/enroll'
                            })
                        }}>注册</p>
                        <p>消息通知</p>
                        <p>购物车 （0）</p>
                    </div>
                </div>
                <div className="home_classify">
                    <div className="home_class_logo">

                    </div>
                    <div className="home_class_items">
                        <p className="home_class_item">全部分类商品</p>
                        <p className="home_class_item">小米手机</p>
                        <p className="home_class_item">Redmi红米</p>
                        <p className="home_class_item">电视</p>
                        <p className="home_class_item">笔记本</p>
                        <p className="home_class_item">家电</p>
                        <p className="home_class_item">路由器</p>
                        <p className="home_class_item">智能硬件</p>
                        <p className="home_class_item">服务</p>
                        <p className="home_class_item">社区</p>
                    </div>
                    <div className="home_class_search">
                        <input placeholder="小米" /><button>🔍</button>
                    </div>
                </div>
                <div className="home_bread">
                    <p>首页 / 关于小米 / 管理团队</p>
                </div>
                <HashRouter>
                    <div className="home_container">
                        <p><Link to="/">公司简介</Link></p>
                        <p><Link to="/team">管理团队</Link></p>
                        <p><Link to="/cultural">小米文化</Link></p>
                        <p><Link to="/exercise">发展经历</Link></p>
                        <p><Link to="/news">小米新闻</Link></p>
                        <p><Link to="/join">加入小米</Link></p>
                        <p><Link to="/relation">投资者关系</Link></p>
                        <p><Link to="/call">联系我们</Link></p>
                    </div>
                    <div className="home_content">
                        <Switch>
                            <Route path="/team" component={Team} />
                            <Route path="/cultural" component={Cultural} />
                            <Route path="/exercise" component={Exercise} />
                            <Route path="/news" component={News} />
                            <Route path="/join" component={Join} />
                            <Route path="/relation" component={Relation} />
                            <Route path="/call" component={Call} />
                            <Route path="/" component={Desc} />
                        </Switch>
                    </div>
                </HashRouter>
            </div>
        )
    }
}

export default Router